﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Collections.Generic;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace ThienLoc
{
    public partial class NoiDungTinTuc : System.Web.UI.Page
    {
        private static int TinTucID;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["mod"] != null)
            {
                TinTucID = Convert.ToInt32(Request.QueryString["mod"].ToString());
                LoadContent(TinTucID);
            }

        }

        private void LoadContent(int mod)
        {
            string sql = "select TenDM,Image,NoiDung from tblTLTinTuc where ID = @ID";
            List<SqlParameter> arrParams = new List<SqlParameter>();
            arrParams.Add(SqlHelper.CreateParameterObject("@ID", SqlDbType.Int, ParameterDirection.Input, mod));
            DataTable dt = SqlHelper.ExecuteDataTable(CommandType.Text, sql, arrParams);
            ltrBreadcrumb.Text = dt.Rows[0]["TenDM"].ToString();
            lblTitle.Text = dt.Rows[0]["TenDM"].ToString();
            TinTucImage.ImageUrl = dt.Rows[0]["Image"].ToString();
            TinTucContent.Text = dt.Rows[0]["NoiDung"].ToString();


        }
    }
}
